﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;

namespace BeatingMole
{
    class CInfoEnemy1 : CInfoEnemy
    {
        #region "Constructor"

        /// <summary>
        /// (Nguyễn Kim Nhất Quý)
        /// Khởi tạo có tham số với 3 biến hệ thống
        /// </summary>
        /// <param name="content"></param>
        /// <param name="sprite"></param>
        /// <param name="gameTime"></param>
        public CInfoEnemy1(ContentManager content)
            : base(content)
        {
            _content = content;

            Health = 1;
            if (content != null)
            {
                SpriteSheet = content.Load<Texture2D>(@"Resource/Mouses/mouse1");
                XmlEnemy = content.Load<Dictionary<string, Rectangle>>(@"Resource/Xml/mouse1");    
            }            
            PosImages = 0;
            NumberFrames = 3;
            PosMouse = Vector2.Zero;
            NameImages = "mole_up_a";
            Status = State.Up;
            TimeAppeared = 1;
            TimeOut = 1;
            Score = 5;       
        }


        /// <summary>
        /// (Nguyễn Kim Nhất Quý)
        /// Khởi tạo có tham số với 3 tham số hệ thống
        /// </summary>
        /// <param name="content"></param>
        /// <param name="sprite"></param>
        /// <param name="gameTime"></param>
        /// <param name="health">Lượng máu của mỗi Enemy</param>
        /// <param name="posImages">Vị trí frame trên tấm hình lớn</param>
        /// <param name="nameImages">Tên frame để cắt hình</param>
        /// <param name="spriteBatch"></param>
        /// <param name="xmlRectangle"></param>
        /// <param name="timeAppeared"></param>
        /// <param name="timeOut"></param>
        /// <param name="posMouse"></param>
        /// <param name="originEnemy"></param>
        /// <param name="status"></param>
        public CInfoEnemy1(ContentManager content, int health, int posImages,
            string nameImages, Texture2D spriteSheet, Dictionary<string, Rectangle> xmlEnemy, int timeAppeared,
            int timeOut, Vector2 posMouse, State status)
            : base(content, health, posImages, nameImages , spriteSheet, xmlEnemy, timeAppeared, timeOut, posMouse, status)
        {

        }

        public CInfoEnemy1(CInfoEnemy1 enemy)
            : base(enemy)
        {

        }
        #endregion

        #region "Methods"
        public override void CheckEnemyStatus()
        {
            switch (this.Status)
            {
                case State.Disapear: NameImages = "mole_disapear_a";
                    PosImages = 0;
                    NumberFrames = 1;
                    break;
                case State.Up: NameImages = "mole_up_a";
                    PosImages = 0;
                    NumberFrames = 3;
                    break;
                case State.Down: NameImages = "mole_down_a";
                    PosImages = 0;
                    NumberFrames = 3;
                    break;
                case State.Die: NameImages = "mole_die_a";
                    PosImages = 0;
                    NumberFrames = 2;
                    break;
            }
        }
        #endregion
    }
}
